<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>关注动态</title>
<link rel="stylesheet" href="../layui/css/layui.css" media="all">
<script type="text/javascript" src="../js/jquery.min.js"></script>
<script type="text/javascript" src="../layui/layui.js"></script>
<script type="text/javascript" src="../js/share_1.js"></script>

	<!-- 网页字体库 -->
	<link href="http://fonts.googleapis.com/css?family=Poppins:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i&amp;subset=devanagari,latin-ext"
	 rel="stylesheet">
	<link href="http://fonts.googleapis.com/css?family=Tangerine:400,700" rel="stylesheet">
	<link href="http://fonts.googleapis.com/css?family=Roboto+Condensed:300,300i,400,400i,700,700i&amp;subset=cyrillic,cyrillic-ext,greek,greek-ext,latin-ext,vietnamese" rel="stylesheet">

<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script>
	layui.use('element', function() {
		var element = layui.element; //导航的hover效果、二级菜单等功能，需要依赖element模块
		//监听导航点击
		element.on('nav(demo)', function(elem) {
			//console.log(elem)
			layer.msg(elem.text());
		});
	});
	$(document).ready(function(){
		
	});
	/* 获取当前用户id */
	var currentUid = 1;
	/* 全部动态 */
	function publish(){
		var options = {
    			url: "/share/publish",
    			method: 'post',
    			data:{
    				uid:currentUid,
    				content:$("#textVal").val()
    			},
			    success: function (data) {
			    	console.info(data);
			    	//获取全部动态
					//allShared();
			    	window.location.reload();
			    }
		}
		$.ajax(options);
	}
	/* 获取当前用户 */
	$(function(){
		$.ajax({
			url:"/user/userMessage",
			type:"post",
			success:function(data){
				if(data.nickName==null || data.nickName==""){
					$("#totle").html("欢迎您:"+data.account)	
				}else{
					$("#totle").html("欢迎您:"+data.nickName)
				}
			}
		});
	});
</script>
</head>

<div class="layui-container" style="width: 60%;height: 720px;">

		<!-- 导航栏 -->
		<ul class="layui-nav">
		  <li class="layui-nav-item">
		   <!-- 	<a href="../home.jsp" id="totle">Yoga</a> -->
		   	<a href="../home.jsp" style="font-family: 'Tangerine', cursive;font-size: 100%;color:white;">Yoga</a>
		  </li>
		  <li class="layui-nav-item" style="float: right;">
		    <a href="#" onClick="javascript :history.back(-1);">返回</a>
		  </li>
		</ul>
		
		<!-- header -->
		<div style="margin-bottom: 15px;">
			<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
			  <legend>圈子</legend>
			</fieldset> 

			 
			<div style="padding: 20px; background-color: #F2F2F2;height: 100px;">
			  <div class="layui-form-item layui-form-text" style="width:80%;float: left;">
			    <div class="layui-input-block" style="margin-left:0;">
			      <textarea placeholder="说点儿什么吧" class="layui-textarea" name="desc" id="textVal"></textarea>
			    </div>
			  </div>
			 
			  <div class="layui-form-item" style="width: 20%;text-align: center;float: right;clear: initial;">
			    <div class="layui-input-block" style="margin-left:0;">
			      <button class="layui-btn" onclick="publish()" lay-submit="" lay-filter="demo1" style="width: 90%;float: right;">发布</button>
			      <button class="layui-btn" onclick="document.getElementById('textVal').value=''" lay-submit="" lay-filter="demo1" style="width: 90%;float: right;margin-top: 22px;">取消</button>
			    </div>
			  </div>
			</div>
		</div>

		<!-- 左侧导航区域（可配合layui已有的垂直导航） -->
		<ul class="layui-nav layui-nav-tree layui-inline" lay-filter="demo">
			<li class="layui-nav-item layui-nav-itemed">
				<a href="javascript:;">全部</a>
				<dl class="layui-nav-child">
					<dd>
						<a href="currentAll.html" target="option">最近动态</a>
					</dd>
					<dd>
						<a href="currentFolloweds.html" target="option">我的关注</a>
					</dd>
					<dd>
						<a href="currentFriends.html" target="option">相互关注</a>
					</dd>
					<dd>
						<a href="currentUser.html" target="option">个人空间</a>
					</dd>
				</dl>
			</li>
		</ul>
		
		<!-- option -->
		<div class="layui-body" style="top:280px;left:230px;right: 15px;overflow-y:hidden;">
			<!-- 内容主体区域 -->
			<iframe id="option" name="option" src="currentAll.html"
				style="overflow: visible;" scrolling="no" frameborder="no"
				width="100%" height="100%"></iframe>
		</div>
</div>

</body>
</html>